/*
 * @(#)ClientConfig.java
 * Date 2014-01-17
 * Version 1.0
 * Author Jim Horner
 * Copyright (c)2012
 */


package us.hornerscorners.lamppost.config;

import org.apache.commons.lang3.StringUtils;


/**
 * Class description
 *
 *
 * @version        v1.0, 2014-01-17
 * @author         Jim Horner
 */
public class ClientConfig implements IServiceConfig {

    /** Field description */
    private static final IServiceType serviceType = new ClientServiceType();

    /** Field description */
    private String id;

    /** Field description */
    private String name;

    /**
     * Constructs ...
     *
     */
    public ClientConfig() {
        super();
    }

    /**
     * Method description
     *
     *
     * @return
     */
    @Override
    public String getId() {
        return id;
    }

    /**
     * Method description
     *
     *
     * @return
     */
    @Override
    public String getName() {
        return name;
    }

    /**
     * Method description
     *
     *
     * @return
     */
    @Override
    public IServiceType getServiceType() {
        
        return ClientConfig.serviceType;
    }

    /**
     * Method description
     *
     *
     * @param id
     */
    public void setId(String id) {
        this.id = id;
    }

    /**
     * Method description
     *
     *
     * @param name
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * Class description
     *
     *
     * @version        v1.0, 2014-01-17
     * @author         Jim Horner
     */
    private static class ClientServiceType implements IServiceType {

        /**
         * Constructs ...
         *
         */
        public ClientServiceType() {
            super();
        }

        /**
         * Method description
         *
         *
         * @return
         */
        @Override
        public String getTypeName() {

            return "Client";
        }

        /**
         * Method description
         *
         *
         * @param type
         *
         * @return
         */
        @Override
        public boolean isSameType(IServiceType type) {

            return StringUtils.equals(getTypeName(), type.getTypeName());
        }
    }
}
